home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Graphics / Gallery / Source / ShowPicture.cpp < prev   
Encoding:
C/C++ Source or Header  |  1997-11-20  |  1.7 KB  |  70 lines

  1. #define __VERSION__     "39"
  2. #define __REVISION__     "1"
  3. #define __NAME__            "ShowPicture"
  4. #define __AUTHOR__        "Markus Hillenbrand"
  5.  
  6. /*********************************************************************************************************/
  7.  
  8. #include <string.h>
  9. #include <stdlib.h>
  10. #include <stdio.h>
  11. #include <stream.h>
  12.  
  13. #include "GUICINCLUDE:GUIC_System.hpp"
  14. #include "GUICINCLUDE:GUIC_Application.hpp"
  15. #include "GUICINCLUDE:GUIC_Screen.hpp"
  16. #include "GUICINCLUDE:GUIC_Event.hpp"
  17. #include "GUICINCLUDE:GUIC_Exceptions.hpp"
  18. #include "GUICINCLUDE:GUIC_ProgramArgs.hpp"
  19.  
  20. #include "/PictureWindow.hpp"
  21.  
  22. /*********************************************************************************************************/
  23.  
  24. STRPTR V = "$VER: " __NAME__ " " __VERSION__ "." __REVISION__ " (" __DATE__ ")";
  25.  
  26. /*********************************************************************************************************/
  27.  
  28. VOID main (LONG argc, STRPTR argv[])
  29. {
  30.     GUIC_SystemC::checkStackSize(50000);
  31.  
  32.     LONG result[] = { 0,0 };
  33.     STRPTR templ = "PUBSCREEN/A,PICTURE/A";
  34.     GUIC_ProgramArgsC args;
  35.     if (! args.fit(templ, result)) { cerr << "Usage: " << templ << endl; return; }
  36.     
  37.     STRPTR screenName = (STRPTR) result[0];
  38.     STRPTR pictureName = (STRPTR) result[1];
  39.     
  40.     GUIC_ApplicationC app(__NAME__);
  41.  
  42.     GUIC_ScreenC            screen( screenName );
  43.     PictureWindowC     pWindow (app, screen);
  44.     
  45.     screen.add(pWindow);
  46.  
  47.     pWindow.setCloseGadgetMode(TRUE);
  48.     pWindow.activate();
  49.     pWindow.setScaled(FALSE);
  50.     pWindow.setCentered(FALSE);
  51.     
  52.     app.add(screen);
  53.     app.start();
  54.  
  55.     pWindow.showPicture( pictureName );
  56.     
  57.     BOOL running = TRUE;
  58.     GUIC_EventC *event = 0;
  59.  
  60.     LONG count = 0;
  61.     
  62.     while (running && (event = app.wait()) )
  63.         {
  64.         if (event->id == GUIC_CloseWindow) running = FALSE;
  65.         }
  66.  
  67.     app.stop();
  68. }
  69.  
  70.